/**
ysbErPatch.mg
*/

class YSBHomeController:YSBViewController {


- (void)viewDidLoad {
    super.viewDidLoad();

    self.annotionArr = NSMutableArray.alloc().init();
    
    NSNotificationCenter.defaultCenter().addObserver:selector:name:object:(self,@selector(getCompanyMsgFormEditVC:),@"getCompantMsgNotification",nil);
    NSNotificationCenter.defaultCenter().addObserver:selector:name:object:(self,@selector(loadLoginStatus),@"loginNotification",nil);
    NSNotificationCenter.defaultCenter().addObserver:selector:name:object:(self,@selector(loadLogoutStatus),@"logoutNotification",nil);
    NSNotificationCenter.defaultCenter().addObserver:selector:name:object:(self,@selector(showTipsAlert:),@"passAllGuideShowAlertNotification",nil);

    self.navigationItem.title = @"";
    
    self.addLeftButtonWithImage:withHighlightedImage:orTitle:(@"home_nav_logo",@"home_nav_logo",nil);
    self.addRightButtonWithImage:withHighlightedImage:orTitle:(@"home_nav_service",@"home_nav_service",@"");
    
    self.configuration();
       
}


- (void)viewDidAppear:(BOOL)animated {
    super.viewDidAppear:(animated);
    YSBMSAlertManager.shareManager().showAlerts();
    self.performSelector:withObject:afterDelay:(@selector(delayMethod),nil,2.5);
    
}


- (void)delayMethod {
    YSBMSAlertManager.shareManager().showAlerts();
}


- (void)navigationRightAction {
    NSString *str = @"tel:400-150-1200";
    UIApplication.sharedApplication().openURL:options:completionHandler:(NSURL.URLWithString:(str),@{},nil);
}




}



class YSBChatRoomWebSocketManager : NSObject {


- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message {


}


}



class YSBMineController : YSBViewController {


- (void)viewDidAppear:(BOOL)animated {
    super.viewDidAppear:(animated);
    YSBMSAlertManager.shareManager().showAlerts();
}


}



class YSBMainADScrollView : UIView {

- (UIButton *)leftBtn {
    if (!_leftBtn) {
        _leftBtn = UIButton.alloc().init();
        _leftBtn.setBackgroundImage:forState:(YSBCommonTool.autoreleasepoolWithImageName:(@"adBox_left"),UIControlStateNormal);
        _leftBtn.addTarget:action:forControlEvents:(self,@selector(leftBtnAction:),UIControlEventTouchUpInside);
        _leftBtn.hidden = self.dataSourse.count < 2 ? YES : NO;
    }
    return _leftBtn;
}

- (UIButton *)rightBtn{
    if (!_rightBtn) {
        _rightBtn = UIButton.alloc().init();
        _rightBtn.setBackgroundImage:forState:(YSBCommonTool.autoreleasepoolWithImageName:(@"adBox_right"),UIControlStateNormal);
        _rightBtn.addTarget:action:forControlEvents:(self,@selector(rightBtnAction:),UIControlEventTouchUpInside);
        _rightBtn.hidden = self.dataSourse.count < 2 ? YES : NO;
    }
    return _rightBtn;
}


}



class YSBSecurityFenceMapViewController : YSBViewController {

- (void)viewWillAppear:(BOOL)animated {
    super.viewWillAppear:(animated);
    self.performSelector:withObject:afterDelay:(@selector(delayMethod),nil,0.5);
    
}


- (void)delayMethod {
    self.mapView.removeAnnotations:(self.annotionArr);
    self.mapView.addAnnotations:(self.annotionArr);
}


- (void)resetMaxRandomNum {
    self.maxRandomNum = 10;
}


- (void)mapView:(MAMapView *)mapView mapDidMoveByUser:(BOOL)wasUserAction {
    self.mapView.removeAnnotations:(self.annotionArr);
    self.mapView.addAnnotations:(self.annotionArr);
}


- (void)mapView:(MAMapView *)mapView mapDidZoomByUser:(BOOL)wasUserAction {
    self.performSelector:withObject:afterDelay:(@selector(delayMethod),nil,0.5);

}



}



class YSBRecordCell : UITableViewCell {


- (void)setModel:(YSBRecordModel *)model {
    _model = model;
    if (self.recordType == 0) {
        
        self.typeLabel.text = @"提现";
        
        NSMutableString *mutStr = NSMutableString.alloc().initWithString:(@"-");
        mutStr.appendString:(model.total);
        self.moneyLabel.text = mutStr;
        
    }
    else if (self.recordType == 2) {
        
        self.typeLabel.text = YSBCommonTool.isBlankString:(model.type) ? @"" : model.type;
                
        NSMutableString *mutStr = NSMutableString.alloc().initWithString:(model.flag);
        mutStr.appendString:(model.money);
        self.moneyLabel.text = mutStr;
        
    }
    else if (self.recordType == 1) {
        
        self.typeLabel.text = @"充值";
        
        NSMutableString *mutStr = NSMutableString.alloc().initWithString:(@"+");
        mutStr.appendString:(model.money);
        self.moneyLabel.text = mutStr;
        
    }
    self.timeLabel.text = model.created_at;
    self.statusLabel.text = model.status;
}


}
